﻿@model IEnumerable<GameSchoolApplication.Models.UserAccount>
           
@{
    ViewBag.Title = "User Overview";
}

<form action="" method="get">

 
 <div>
    <table  border="1">
    <thead><tr><th>Nafn</th><th>SSN</th><th>Email   </th><th> </th></tr></thead>
    <tbody id="accountDisplay">   
    
        @foreach (var u in Model)
         {
             <tr>
                <td>@u.name</td>
                <td>@u.userID</td>
                <td>@u.email</td>
                <td class="editUser">@Html.ActionLink("Breyta Notanda", "editUserPage", "Account", new { userID = u.userID }, null)</td>
             </tr>
        }
    </tbody>
    </table>
</div>
</form>

<!--
TODO: skrifa... framework sem tekur á móti IEnum{ CourseID,CourseName} til að leita eftir
-->
<!--AJAX fyrir flokkaskiptingu og leit-->
<script id="userEntryTemplate" type="text/html">
    <tr id="userEntry">
        <td>${name}</td>
        <td>${userID}</td>
        <td>${userName}</td>
        <td>${email}</td>
        <td><button class="editUser" value=${userID}>Edit</button></td>
    </tr>
</script>

